<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="support.*, java.util.*, java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Verification</title>
</head>
<%
	student stu = (student)session.getAttribute("student");
	DegreeContainer degrees = (DegreeContainer)session.getAttribute("DegreeContainer");
	String specialization = request.getParameter( "specialization" );
	
%>
<body>

	<h1>Verification</h1>
	<%
		
		
		
		out.println(stu.printAttributes());

		
		//Iterate through degrees inside the container
		
    	
		for(int i = 0; i < degrees.getSize(); i++){ 
			degree d = degrees.getDegree(i);
			
			//set the same specialization attribute for all degrees	
		    d.setAttribute("specialization", specialization);
		
			String location = d.getAttribute("location");
			String university = d.getAttribute("university");
			String major = d.getAttribute("major");
			String month = d.getAttribute("month");
			String year = d.getAttribute("year");
			String gpa = d.getAttribute("gpa");
			String title = d.getAttribute("title");
			String transcript = d.getAttribute("transcript");
	%>
	<h2>Degree <%= i+1 %></h2>
	<h3>
		Location: <%= location %><br>
		University: <%= university %><br>
		Major: <%= major %><br>
		Month: <%= month %><br>
		Year: <%= year %><br>
		GPA: <%= gpa %><br>
		Title: <%= title %><br>
		Transcript: <%= transcript %><br>
		Specialization: <%= specialization %><br>
	
	</h3>
	<%	} %>
	
	<form method="GET" action="submitapp.jsp">
	   <input type="submit" value="Submit Application"/>
   </form>
   
   <form method="GET" action="cancel.jsp">
	   <input type="submit" value="Cancel"/>
   </form>
   
   <% 
   		//Make sure to add the degree container back into the session object 
   		//Because we added the new specialization objects
   		session.setAttribute("DegreeContainer", degrees);
   %>
</body>
</html>